﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using PloobsEngine.IA;
using PloobsEngine.SceneControl;
using PloobsEngine.Draw;

namespace Etapa1.SteeringExperiments
{
    public class SteeringAgent : IAgent
    {
        public SteeringAgent(IObject obj)
        {
            this.obj = obj;
            obj.Agente = this;            
            sei = new SteeringEntityInfo(obj, 50, 50,10);
            sb = new SteeringBehavior();
        }

        IObject obj;        
        SteeringBehavior sb;
        SteeringEntityInfo sei;

        public SteeringEntityInfo SteeringEntityInfo
        {
            get { return sei; }
            set { sei = value; }
        }

        public SteeringBehavior SteeringBehavior
        {
            get { return sb; }
            set { sb = value; }
        }
        #region IAgent Members

        public void Update(Microsoft.Xna.Framework.GameTime gt)
        {
            Drawing.Draw3dLine(obj.Position, obj.Position + obj.PhysicObject.Velocity, Color.Blue);
            Drawing.Draw3dLine(obj.Position, obj.Position + obj.PhysicObject.FaceVector * 20, Color.BlueViolet);
            sb.Update(gt,sei);   
        }

        public IObject Obj
        {
            get
            {
                return obj;
            }
            set
            {
                this.obj = value;
            }
        }

        #endregion
    }
}
